package com.boguan.device.mapper;

import com.boguan.common.core.domain.entity.SysUser;
import com.boguan.device.domain.DeviceAlarmLog;
import com.boguan.device.domain.DeviceLog;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface DeviceAlarmLogMapper {
    int deleteByPrimaryKey(Long id);

    int insert(DeviceAlarmLog record);

    int insertSelective(DeviceAlarmLog record);

    DeviceAlarmLog selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(DeviceAlarmLog record);

    int updateByPrimaryKey(DeviceAlarmLog record);

    List<DeviceAlarmLog> searchPage(DeviceAlarmLog alarmLog);

    List<Map<String, Object>> alarmNumber(SysUser user);

    Integer untreatedAlarmNumber(SysUser user);

    List<Map<String, Object>> analysisAlarmNumber(SysUser user);

    Integer selectAlarmCount(SysUser user);

    List<Map<String, Integer>> untreatedAlarmCount(SysUser user);

    List<Map<String, Object>> alarmCountTrend(SysUser user);

    List<Map<String, Integer>> alarmLevelCount(SysUser user);

    DeviceAlarmLog selectAlarmByError(@Param("deviceId") Long deviceId,
                                      @Param("eventName") String eventName,
                                      @Param("errorStatus") Integer errorStatus,
                                      @Param("status") Integer status);

    int deleteByDeviceId(Long deviceId);

    int selectAlarmCountByDeviceId(@Param("deviceId") Long deviceId,@Param("identifier") String identifier);

}